Spreadsheets perform a wide variety of tasks and have proliferated in businesses, homes, academia, and in a multitude of other environments. This proliferation has been due, in part, to the ability of spreadsheets to calculate new data from existing data.
A spreadsheet program may comprise one or more worksheets each of which is divided into a rectangular grid made up of columns and rows as shown in FIG. 1. A letter assigned to each column appears in the column header just above the worksheet grid. A number assigned to each row appears in the header to the left of the worksheet grid. A cell is formed at the intersection of each column and row.
The cells form the basic building blocks of the worksheet. Each cell is assigned a unique set of coordinates consisting of its column and row number, called a cell reference. A cell reference serves as a pointer to a particular cell. When a cell reference is called by another cell, the referenced cell returns its value to the calling cell. Thus, one cell is able to obtain and use the numeric value of another cell by simply referencing it.
Additionally, a cell may obtain and use the numeric values of a group of cells by referencing the area of the group. An area reference comprises two cell references, that of the top left cell in a group and that of the bottom right cell in the group. For the sake of convenience, the term cell reference will be used herein to refer to both references to a particular cell and to references to an area.
The value of a cell may be a number or text stored in the cell, or the value may be the solution to a formula that is stored in the cell. A formula is stored in a cell in a tokenized form. The formula consists of mathematical operations to be performed along with any cell references for values required for the mathematical operations. The worksheet automatically calculates solutions for the formula by retrieving values of the cell references in the formula and performing the mathematical operations defined by the formula.
A cell reference in a formula may be absolute or relative with respect to the location of the cell containing the formula. An absolute reference to a cell in a formula points to the absolute location of that cell on the worksheet and remains the same when the formula is copied to other cells. Absolute references are utilized when the value of a cell having a particular location is always intended for use in the formula regardless of the location of the cell containing the formula. Conversely, a relative reference to a cell points to the location of the cell in relation to the cell that contains the formula and necessarily changes when a formula is copied to other cells in order to preserve that relation. Relative references are utilized when the value of a cell, having a particular offset from the cell containing the formula rather than a particular location in the worksheet, is always intended for use in the formula.
Because a formula is stored separately in the worksheet from any values used in the formula's computations, the formula need not be modified when the value of a referenced cell is changed. Rather, the solution for the formula need only be recomputed. Because the worksheet recomputes the solution automatically, the value calculated by the formula of a worksheet, the new data, remains current even after the underlying values, the existing data, have been changed.
The separate storage of formulas in their entirety and values, however, requires a large amount of memory as compared to storing only the values of the solutions of the formulas. To reduce the amount of storage required by formulas, an attempt has been made in the prior art to store only one copy of formulas that are common to a continuous cell group and to share that formula among the cells of the cell group. As used herein, the phrase common formulas means formulas in a continuous cell group in which the mathematical operations and the absolute references are identical and in which the relative references have the same offset. Common formulas occur as a consequence of copying a formula to other cells and are frequently used to manipulate different series of the same data in the same manner.
A shared formula, as distinguished from a common formula, is stored in tokenized form. The shared formula consists of mathematical operations and the absolute cell references of the values required by the mathematical operations. The absolute cell references are identical for a common formula set. Because the relative cell references are different for each formula in a common formula set, however, relative cell references cannot be stored directly in the shared formula. Instead, the offsets of the relative cell references are stored in the shared formula. The offsets of the relative cell references are identical for a common formula set.
Each cell that shares a formula contains a pointer to that formula in order to link it with the formula. The formula is stored separately from the cell. Solutions to a shared formula are automatically calculated by the worksheet for each cell by applying the offsets to determine the relative cell references, retrieving the values of the cell references, both absolute and relative, and performing on them the mathematical operations defined by the shared formula.
The above described method of sharing formulas in the prior art was successful in reducing the amount of storage required by formulas. A problem, however, with formula sharing is that a shared formula could not be modified in response to editing operations, as is done for individual formulas residing in cells. As used herein the term editing operation means the insertion or deletion of rows or columns, which causes a shift in the existing cells of a worksheet and thus the cell references of the formulas therein. Thus, in shared formulas, cell references to values that were shifted by editing operations were not updated. As a result, the shared formulas were left outdated, which caused the values calculated by the shared formulas to be erroneous. Because that result was unacceptable, formula sharing was abandoned despite its benefit in reducing the amount of storage required by formulas.
Therefore, there exists a need in the art for a method and system of updating shared formulas in response to editing operations such that they remain current and yield correct solutions. Further, there exists a need in the art for an improved method and system of sharing formulas in a spreadsheet program such that they may be easily adjusted upon editing operations.